package com.linwen.excise.sort;

/**
 * @ClassName Sortutil
 * @Description 排序工具类
 * @Author zero
 * @DATE 2024/8/11 11:27 AM
 * @Version 1.0
 */
public class Sortutil {
    public static void swap(int[] arr, int i, int j) {
        int temp = arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
    }

    public static void swap2(int[] arr, int i, int j) {
        if(i == j){
            return;
        }
        arr[i] = arr[i] ^ arr[j];
        arr[j] = arr[i] ^ arr[j];
        arr[i] = arr[i] ^ arr[j];
    }
}
